<template>
    <view class="hotspot" :style="style">
        <slot></slot>
    </view>
</template>

<script setup lang='ts' name="AppHotspot">
export interface AppHotspotProps {
    hotspot: {
        left: string
        top: string
        width: string
        height: string
    }
}
const props = defineProps<AppHotspotProps>()

const style = computed(() => {
    if (props.hotspot) {
        const { left, top, width, height } = props.hotspot
        return {
            left: `${left}rpx`,
            top: `${top}rpx`,
            width: `${width}rpx`,
            height: `${height}rpx`,
        }
    }
    else return {}

})

</script>

<style scoped>

</style>